﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
    public class HoaDonBanObj
    {
        private string _HoadonbanID;

        public string HoadonbanID
        {
            get { return _HoadonbanID; }
            set { _HoadonbanID = value; }
        }
        private string _Ngaylap;

        public string Ngaylap
        {
            get { return _Ngaylap; }
            set { _Ngaylap = value; }
        }
        private string _KhachID;

        public string KhachID
        {
            get { return _KhachID; }
            set { _KhachID = value; }
        }
        private string _Chietkhau;

        public string Chietkhau
        {
            get { return _Chietkhau; }
            set { _Chietkhau = value; }
        }
        private string _Hinhthucchietkhau;

        public string Hinhthucchietkhau
        {
            get { return _Hinhthucchietkhau; }
            set { _Hinhthucchietkhau = value; }
        }
        private string _Noidungchietkhau;

        public string Noidungchietkhau
        {
            get { return _Noidungchietkhau; }
            set { _Noidungchietkhau = value; }
        }
        public HoaDonBanObj SetValuesFromDataReader(IDataReader reader)
        {
            HoaDonBanObj obj = new HoaDonBanObj();
            obj.HoadonbanID = (reader["HoadonbanID"] is DBNull) ? String.Empty : reader["HoadonbanID"].ToString();
            obj.Ngaylap = (reader["Ngaylap"] is DBNull) ? String.Empty : reader["Ngaylap"].ToString();
            obj.KhachID = (reader["KhachID"] is DBNull) ? String.Empty : reader["KhachID"].ToString();
            obj.Chietkhau = (reader["Chietkhau"] is DBNull) ? "0" : reader["Chietkhau"].ToString();
            obj.Hinhthucchietkhau = (reader["Hinhthucchietkhau"] is DBNull) ? "0" : reader["Hinhthucchietkhau"].ToString();
            obj.Noidungchietkhau = (reader["Noidungchietkhau"] is DBNull) ? String.Empty : reader["Noidungchietkhau"].ToString();
            return obj;
        }
    }
}
